package com.examine.dao;

public class DataRow {
	private Object[] values;
	private DataTable owner;
	
	public DataRow(int size,DataTable owner) {
		this.values=new Object[size];
		this.owner=owner;
	}
	
	public void Set(int index, Object value){
		values[index]=value;
	}
	
	public void Set(String columnLable, Object value){
		values[owner.getColumnIndex(columnLable)]=value;
	}
	
	public Object getObject(int index){
		return values[index];
	}
		
	public Object getObject(String columnLable){
		return values[owner.getColumnIndex(columnLable)];
	}
	
	public <T> T get(String columnLable,Class<T> clazz){
		return (T)values[owner.getColumnIndex(columnLable)];
	}
}
